import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import { registerStore } from '@/stores'

// elementUiIcon
// import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'

import '@/assets/scss/index.scss'

// 国际化
import lang from './locales'
//引入dayjs日期插件
import dayjs from 'dayjs'

const app = createApp(App)

// 这种全局引入所有图标，暂不推荐
// for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
//   app.component(key, component)
// }
app.use(createPinia())
app.use(router)
app.use(lang)

//通过provide全局注入工具函数
app.provide('$dayjs', dayjs)

// 注册pinia状态管理库
registerStore()

app.mount('#app')
